/[enwfd]/.test(ch) && /\b(keywords|case|else|return|throw|new|in|(instance|type)of|delete|void)$/.test(input.slice(pos - 10, pos));// Acorn: Loose parser//// This module provides an alternative parser (`parse_dammit`) that// exposes that same interface as `parse`, but will try to parse// anything as JavaScript, repairing syntax error the best it can.// There are circumstances in which it will raise an error and give// up, but they are very rare. The resulting AST will be a mostly// valid JavaScript AST (as per the [Mozilla parser API][api], except// that://// - Return outside functions is allowed//// - Label consistency (no conflicts, break only to existing labels)// is not enforced.//// - Bogus Identifier nodes with a name of `"*"` are inserted whenever// the parser got too confused to return anything meaningful.//// [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API//// The expected use for this is to *first* try `acorn.parse`, and only// if that fails switch to `parse_dammit`. The loose parser might// parse badly indented code incorrectly, so **don't** use it as// your default parser.//// Quite a lot of acorn.js is duplicated here. The alternative was to// add a *lot* of extra cruft to that file, making it less readable// and slower. Copying and editing the code allowed me to make// invasive changes and simplifications without creating a complicated// tangle.(function(root, mod) { if (typeof exports == "object" && typeof module == "object") return mod(exports, require("./acorn")); // CommonJS if (typeof define == "function" && define.amd) return define(["exports", "./acorn"], mod); // AMD mod(root.acorn || (root.acorn = {}), root.acorn); // Plain browser env})(this, function(exports, acorn) { "use strict"; var tt = acorn.tokTypes; var options, input, fetchToken, context; exports.parse_dammit = function(inpt, opts) { if (!opts) opts = {}; input = String(inpt); options = opts; if (!opts.tabSize) opts.tabSize = 4; fetchToken = acorn.tokenize(inpt, opts); sourceFile = options.sourceFile || null; context = []; nextLineStart = 0; ahead.length = 0; next(); return parseTopLevel(); }; var lastEnd, token = {start: 0, end: 0}, ahead = [];